import axios from 'axios';

const BASE_URL = ' http://localhost:1025/'; // 替换为你实际的后端地址

export const fetchBookshelf = (userId) => {
  return axios.get(`${BASE_URL}/bookshelf/${userId}`);
};

export const addBookshelf = (userId, bookId, preContentId) => {
  return axios.post(`${BASE_URL}/bookshelf`, { userId, bookId, preContentId });
};

export const deleteBookshelf = (userId, bookId) => {
  return axios.delete(`${BASE_URL}/bookshelf/${userId}/${bookId}`);
};

export const updateBookshelf = (userId, bookId, preContentId) => {
  return axios.put(`${BASE_URL}/bookshelf/${userId}/${bookId}`, { preContentId });
};
